/**
 * @filename:SignInServiceImpl SignInfo
 * @project constract  V1.0
 * Copyright(c) 2018 bot Co. Ltd. 
 * All right reserved. 
 */
package com.znufe.exam.service.impl;

import java.util.List;

import com.znufe.exam.viewmodel.vote.signin.ChangeSignInStatusRequestVM;
import com.znufe.exam.viewmodel.vote.signin.SignInCreateVM;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.znufe.exam.domain.vote.SignIn;
import com.znufe.exam.repository.SignInMapper;
import com.znufe.exam.service.SignInService;

/**   
 *  
 * @Description:  学生签到信息类——SERVICEIMPL
 * @Author:       bot   
 * @CreateDate:   SignInfo
 * @Version:      V1.0
 *    
 */
@Service
public class SignInServiceImpl extends BaseServiceImpl<SignIn> implements SignInService {

	private final SignInMapper signInMapper;

	@Autowired
	public SignInServiceImpl(SignInMapper signInMapper) {
	    super(signInMapper);
		this.signInMapper = signInMapper;
	}
	
	//查询对象
	@Override
	public SignIn selectByPrimaryKey(Integer id) {
		return signInMapper.selectByPrimaryKey(id);
	}

	//按班级id与学生id查询对象
	@Override
	public SignIn selectByStuIdAndClassId(ChangeSignInStatusRequestVM requestVM) {
		return signInMapper.selectByStuIdAndClassId(requestVM);
	}

	//删除对象
	@Override
	public int deleteByPrimaryKey(Integer id) {
		return signInMapper.deleteByPrimaryKey(id);
	}
	
	//添加对象
	@Override
	public int insertSelective(SignIn signIn) {
		return signInMapper.insertSelective(signIn);
	}
	
	//修改对象
	@Override
	public int updateByPrimaryKeySelective(SignIn signIn) {
		return signInMapper.updateByPrimaryKeySelective(signIn);
	}
	
	//查询集合
	@Override
	public List<SignIn> querySignInList(SignIn signIn) {
		return signInMapper.querySignInList(signIn);
	}

	//批量导入签到信息
	public int insertBatchSignInInfo(List<SignInCreateVM> studentsSignInInfoToImport) {
		return signInMapper.insertBatchSignInInfo(studentsSignInInfoToImport);
	}

}